www.gusucode.com > 智睿学校网站管理系统 V2.20 > 智睿学校网站管理系统 V2.20\code\admin\Admin_Edit.asp
<!--#include file="../Include/conn.asp"--> <!--#include file="Admin_check.asp"--> <!--#include file="../Include/md5.asp"--> <% response.expires = 0 response.expiresabsolute = now() - 1 response.addHeader "pragma","no-cache" response.addHeader "cache-control","private" Response.cachecontrol = "no-cache" if Instr(session("AdminPurview"),"|211,")=0 then response.write ("<font color='red')>你不具有该管理模块的操作权限,请返回!</font>") response.end end if '========判断是否具有管理权限 %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <link href="images/Admin_css.css" type=text/css rel=stylesheet> <script language="javascript" src="images/Admin.js"></script> <title>管理员管理</title> </head> <body> <% dim Result Result=request.QueryString("Result") dim ID,AdminName,Working,Password,vPassword,UserName,Purview,Explain,AddTime ID=request.QueryString("ID") if ID="" then ID=0 call AdminEdit() %> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6298E1"> <tr> <td height="24" nowrap background="images/skin/th_bg.gif"><font color="#FFFFFF"> <strong>管理员:添加,修改管理员</strong></font></td> </tr> <tr> <td height="24" align="center" nowrap bgcolor="#EBF2F9"><a href="Admin_Edit.asp?Result=Add" >添加管理员</a><font color="#0000FF"> | </font><a href="Admin_List.asp" >查看所有管理员</a>| </font><a href="Admin_log.asp" >查看登陆日志</a></td> </tr> </table> <br> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#6298E1"> <form name="editForm" method="post" action="Admin_Edit.asp?Action=SaveEdit&Result=<%=Result%>&ID=<%=ID%>" onSubmit="return CheckAdminEdit()"> <tr> <td height="24" nowrap bgcolor="#EBF2F9"><table width="100%" border="0" cellpadding="0" cellspacing="0" id=editProduct idth="100%"> <tr> <td width="120" height="20" align="right"> </td> <td> </td> </tr> <tr> <td height="25" align="right">登录帐号:</td> <td><input name="AdminName" type="text" class="textfield" id="AdminName" style="WIDTH: 120;" value="<%=AdminName%>" maxlength="16" <%if Result="Modify" then response.write ("readonly")%>> * 3-10位字符,不可修改</td> </tr> <tr> <td height="25" align="right">生 效:</td> <td><input name="Working" type="checkbox" value="1" style="HEIGHT: 13px;WIDTH: 13px;" <%if Working=1 then response.write ("checked")%>></td> </tr> <tr> <td height="25" align="right">密 码:</td> <td><input name="Password" type="password" class="textfield" id="Password" maxlength="20" style="WIDTH: 120;"> * 6-16位字符,不填表未修改密码</td> </tr> <tr> <td height="25" align="right">确认密码:</td> <td><input name="vPassword" type="password" class="textfield" id="vPassword" maxlength="20" style="WIDTH: 120;"> *</td> </tr> <tr> <td height="25" align="right">管理员名:</td> <td><input name="UserName" type="text" class="textfield" id="UserName" style="WIDTH: 120;" value="<%=UserName%>"></td> </tr> <tr> <td height="25" align="right">权限设置:</td> <td> <input onClick="CheckOthers(this.form)" name="buttonOtherSelect" type="button" class="button" id="submitOtherSelect" value="选择" style="HEIGHT: 18px;WIDTH: 36px;"></td> </tr> <tr > <td height="25" align="right">系统配置:</td> <td nowrap> <input name="Purview111" type="checkbox" value="|111," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|111,")>0 then response.write ("checked")%>> 网站配置 <input name="Purview112" type="checkbox" value="|112," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|112,")>0 then response.write ("checked")%>> 导航管理 <input name="Purview113" type="checkbox" value="|113," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|113,")>0 then response.write ("checked")%>> 信箱管理 <input name="Purview114" type="checkbox" value="|114," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|114,")>0 then response.write ("checked")%>> 文件管理 <input name="Purview115" type="checkbox" value="|115," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|115,")>0 then response.write ("checked")%>> 扩展管理 <input name="Purview116" type="checkbox" value="|116," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|117,")>0 then response.write ("checked")%>> 广告管理 <input name="Purview117" type="checkbox" value="|117," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|118,")>0 then response.write ("checked")%>> 链接管理 <input name="Purview118" type="checkbox" value="|118," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|118,")>0 then response.write ("checked")%>> 关于我们 <input name="Purview119" type="checkbox" value="|119," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|119,")>0 then response.write ("checked")%>> 数据空间 <input name="Purview121" type="checkbox" value="|121," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|121,")>0 then response.write ("checked")%>> 封锁管理 <input name="Purview122" type="checkbox" value="|122," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|122,")>0 then response.write ("checked")%>> 评论管理 <input name="Purview123" type="checkbox" value="|123," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|123,")>0 then response.write ("checked")%>> 安全注入 </td> </tr> <tr > <td height="25" align="right">用户管理:</td> <td> <input name="Purview211" type="checkbox" value="|211," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|211,")>0 then response.write ("checked")%>> 管理帐号 <input name="Purview212" type="checkbox" value="|212," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|212,")>0 then response.write ("checked")%>> 密码修改 <input name="Purview213" type="checkbox" value="|213," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|213,")>0 then response.write ("checked")%>> 管理帐号 <input name="Purview214" type="checkbox" value="|214," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|214,")>0 then response.write ("checked")%>> 密码修改 </td> </tr> <tr > <td height="25" align="right">新闻管理:</td> <td> <input name="Purview311" type="checkbox" value="|311," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|311,")>0 then response.write ("checked")%>> 栏目管理 <input name="Purview312" type="checkbox" value="|312," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|312,")>0 then response.write ("checked")%>> 栏目添加 <input name="Purview313" type="checkbox" value="|313," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|313,")>0 then response.write ("checked")%>> 新闻管理 <input name="Purview314" type="checkbox" value="|314," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|314,")>0 then response.write ("checked")%>> 新闻添加</td> </tr> <tr > <td height="25" align="right">教师管理:</td> <td> <input name="Purview1011" type="checkbox" value="|1011," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|1011,")>0 then response.write ("checked")%>> 栏目管理 <input name="Purview1012" type="checkbox" value="|1012," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|1012,")>0 then response.write ("checked")%>> 栏目添加 <input name="Purview1013" type="checkbox" value="|1013," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|1013,")>0 then response.write ("checked")%>> 教师管理 <input name="Purview1014" type="checkbox" value="|1014," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|1014,")>0 then response.write ("checked")%>> 教师添加</td> </tr> <tr > <td height="25" align="right">德育管理:</td> <td> <input name="Purview511" type="checkbox" value="|511," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|511,")>0 then response.write ("checked")%>> 栏目管理 <input name="Purview512" type="checkbox" value="|512," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|512,")>0 then response.write ("checked")%>> 栏目添加 <input name="Purview513" type="checkbox" value="|513," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|513,")>0 then response.write ("checked")%>> 德育管理 <input name="Purview514" type="checkbox" value="|514," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|514,")>0 then response.write ("checked")%>> 德育添加</td> </tr> <tr > <td height="25" align="right">成绩管理:</td> <td> <input name="Purview611" type="checkbox" value="|611," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|611,")>0 then response.write ("checked")%>> 成绩管理 <input name="Purview612" type="checkbox" value="|612," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|612,")>0 then response.write ("checked")%>> 成绩添加 </td> </tr> <tr > <td height="25" align="right">资源管理:</td> <td> <input name="Purview711" type="checkbox" value="|711," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|711,")>0 then response.write ("checked")%>> 栏目管理 <input name="Purview712" type="checkbox" value="|712," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|712,")>0 then response.write ("checked")%>> 栏目添加 <input name="Purview713" type="checkbox" value="|713," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|713,")>0 then response.write ("checked")%>> 资源管理 <input name="Purview714" type="checkbox" value="|714," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|714,")>0 then response.write ("checked")%>> 资源添加</td> </tr> <tr > <td height="25" align="right">作品管理:</td> <td> <input name="Purview811" type="checkbox" value="|811," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|811,")>0 then response.write ("checked")%>> 栏目管理 <input name="Purview812" type="checkbox" value="|812," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|812,")>0 then response.write ("checked")%>> 栏目添加 <input name="Purview813" type="checkbox" value="|813," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|813,")>0 then response.write ("checked")%>> 作品管理 <input name="Purview814" type="checkbox" value="|814," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|814,")>0 then response.write ("checked")%>> 作品添加 <input name="Purview815" type="checkbox" value="|815," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|815,")>0 then response.write ("checked")%>> 图片管理 </td> </tr> <tr > <td height="25" align="right">招聘管理:</td> <td> <input name="Purview411" type="checkbox" value="|411," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|411,")>0 then response.write ("checked")%>> 栏目管理 <input name="Purview412" type="checkbox" value="|412," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|412,")>0 then response.write ("checked")%>> 栏目添加 <input name="Purview413" type="checkbox" value="|413," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|413,")>0 then response.write ("checked")%>> 职位管理 <input name="Purview414" type="checkbox" value="|414," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|414,")>0 then response.write ("checked")%>> 职位添加 <input name="Purview415" type="checkbox" value="|415," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|415,")>0 then response.write ("checked")%>> 职位应聘 </td> </tr> <tr > <td height="25" align="right">报名管理:</td> <td> <input name="Purview911" type="checkbox" value="|911," style="HEIGHT: 13px;WIDTH: 13px;" <%if Instr(Purview,"|911,")>0 then response.write ("checked")%>> 报名管理</td> </tr> <tr> <td height="25" align="right" valign="top">备注说明:</td> <td><textarea name="Explain" cols="88" rows="3" class="textfield" id="Explain" style="WIDTH: 580;" ><%=Explain%></textarea></td> </tr> <tr> <td height="30" align="right"> </td> <td valign="bottom"><input name="submitSaveEdit" type="submit" class="button" id="submitSaveEdit" value="保存" style="WIDTH: 60;" ></td> </tr> <tr> <td height="20" align="right"> </td> <td valign="bottom"> </td> </tr> </table></td> </tr> </form> </table> </BODY> </HTML> <% sub AdminEdit() dim Action,rsCheckAdd,rs,sql Action=request.QueryString("Action") if Action="SaveEdit" then '保存编辑管理员 set rs = server.createobject("adodb.recordset") if Result="Add" then '创建网站管理员 set rsCheckAdd = conn.execute("select AdminName from zhi_rui_s_manage where AdminName='" & trim(Request.Form("AdminName")) & "'") if not (rsCheckAdd.bof and rsCheckAdd.eof) then '判断此管理员名是否存在 response.write "<script language=javascript> alert('" & trim(Request.Form("AdminName")) & "管理员已经存在,请换一个登录名再试试!');history.back(-1);</script>" response.end end if sql="select * from zhi_rui_s_manage" rs.open sql,conn,1,3 rs.addnew if len(trim(Request.Form("AdminName")))<3 or len(trim(Request.Form("Password")))>10 then response.write "<script language=javascript> alert('管理员登录名必填,且字符数为3-10位!');history.back(-1);</script>" response.end end if if len(trim(Request.Form("Password")))<6 or len(trim(Request.Form("Password")))>16 then response.write "<script language=javascript> alert('管理员密码必填,且字符数为6-16位!');history.back(-1);</script>" response.end end if if Request.Form("Password")<>Request.Form("vPassword") then response.write "<script language=javascript> alert('两次输入的密码不一样!');history.back(-1);</script>" response.end end if rs("AdminName")=trim(Request.Form("AdminName")) if Request.Form("Working")=1 then rs("Working")=Request.Form("Working") else rs("Working")=0 end if rs("Password")=md5(Request.Form("Password")) rs("UserName")=trim(Request.Form("UserName")) rs("AdminPurview")=Request.Form("Purview111") & Request.Form("Purview112") & Request.Form("Purview113") & Request.Form("Purview114") & Request.Form("Purview115") &_ Request.Form("Purview116") & Request.Form("Purview117") & Request.Form("Purview118") & Request.Form("Purview119") & Request.Form("Purview120") & Request.Form("Purview121") & Request.Form("Purview122") & Request.Form("Purview123")&_ Request.Form("Purview211") & Request.Form("Purview212") & Request.Form("Purview213") & Request.Form("Purview214") &_ Request.Form("Purview311") & Request.Form("Purview312") & Request.Form("Purview313") & Request.Form("Purview314") &_ Request.Form("Purview1011") & Request.Form("Purview1012") & Request.Form("Purview1013") & Request.Form("Purview1014") &_ Request.Form("Purview511") & Request.Form("Purview512") & Request.Form("Purview513") & Request.Form("Purview514") &_ Request.Form("Purview611") & Request.Form("Purview612") &_ Request.Form("Purview711") & Request.Form("Purview712") & Request.Form("Purview713") & Request.Form("Purview714") &_ Request.Form("Purview411") & Request.Form("Purview412") & Request.Form("Purview413") & Request.Form("Purview414") & Request.Form("Purview415") &_ Request.Form("Purview811") & Request.Form("Purview812") & Request.Form("Purview813") & Request.Form("Purview814") & Request.Form("Purview815") &_ Request.Form("Purview911") & Request.Form("Purview912") rs("Explain")=trim(Request.Form("Explain")) rs("AddTime")=now() end if if Result="Modify" then '修改网站管理员 sql="select * from zhi_rui_s_manage where ID="&ID rs.open sql,conn,1,3 rs("AdminName")=trim(Request.Form("AdminName")) if Request.Form("Working")=1 then rs("Working")=Request.Form("Working") else rs("Working")=0 end if if trim(Request.Form("Password"))<>"" then if len(trim(Request.Form("Password")))<6 or len(trim(Request.Form("Password")))>20 then response.write "<script language=javascript> alert('管理员密码必填,且字符数为6-20位!');history.back(-1);</script>" response.end end if if Request.Form("Password")<>Request.Form("vPassword") then response.write "<script language=javascript> alert('两次输入的密码不一样!');history.back(-1);</script>" response.end end if rs("Password")=md5(Request.Form("Password")) end if rs("UserName")=trim(Request.Form("UserName")) rs("AdminPurview")=Request.Form("Purview111") & Request.Form("Purview112") & Request.Form("Purview113") & Request.Form("Purview114") & Request.Form("Purview115") &_ Request.Form("Purview116") & Request.Form("Purview117") & Request.Form("Purview118") & Request.Form("Purview119") & Request.Form("Purview121") & Request.Form("Purview122") & Request.Form("Purview123")&_ Request.Form("Purview211") & Request.Form("Purview212") & Request.Form("Purview213") & Request.Form("Purview214")&_ Request.Form("Purview311") & Request.Form("Purview312") & Request.Form("Purview313") & Request.Form("Purview314") &_ Request.Form("Purview1011") & Request.Form("Purview1012") & Request.Form("Purview1013") & Request.Form("Purview1014") &_ Request.Form("Purview511") & Request.Form("Purview512") & Request.Form("Purview513") & Request.Form("Purview514") &_ Request.Form("Purview611") & Request.Form("Purview612") &_ Request.Form("Purview711") & Request.Form("Purview712") & Request.Form("Purview713") & Request.Form("Purview714") &_ Request.Form("Purview411") & Request.Form("Purview412") & Request.Form("Purview413") & Request.Form("Purview414") & Request.Form("Purview415") &_ Request.Form("Purview811") & Request.Form("Purview812") & Request.Form("Purview813") & Request.Form("Purview814") & Request.Form("Purview815") &_ Request.Form("Purview911") & Request.Form("Purview912") rs("Explain")=trim(Request.Form("Explain")) end if rs.update rs.close set rs=nothing response.write "<script language=javascript> alert('成功编辑网站管理员!');location.replace('Admin_List.asp');</script>" else '提取管理员 if Result="Modify" then set rs = server.createobject("adodb.recordset") sql="select * from zhi_rui_s_manage where ID="& ID rs.open sql,conn,1,1 AdminName=rs("AdminName") Working=rs("Working") UserName=rs("UserName") Purview=rs("AdminPurview") Explain=rs("Explain") rs.close set rs=nothing end if end if end sub %>